import { PerspectiveCamera } from "three";
import { Size } from "./size";
/**
 * 初始化相机
 * @param options - 相机配置选项
 * @returns PerspectiveCamera 实例
 */
export default function initCamera({
  fov = 50,
  aspect = Size.width / Size.height,
  near = 0.1,
  far = 50,
  position = { x: 0, y: 5, z: 20 },
} = {}) {
  const camera = new PerspectiveCamera(fov, aspect, near, far);

  camera.position.set(position.x, position.y, position.z);
  // camera.lookAt(0, 0, 0);
  camera.updateProjectionMatrix();
  return camera;
}
